<?php
// Thanks to Kugelfish and gulli.com
function hex2str($hexstr) {

$hexstr = str_replace(' ', '', $hexstr);
$retstr = pack('H*', $hexstr);
return $retstr;
}

$iv_hex  = "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF";
$key_hex = "8C 35 19 2D 96 4D C3 18 2C 6F 84 F3 25 22 39 EB 4A 32 0D 25 00 00 00 00";

$iv = hex2str($iv_hex);
$key = hex2str($key_hex);
$iv2 = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $iv, MCRYPT_MODE_ECB, "0000000000000000");

$data = file_get_contents('test.rsdf');
$data = hex2str($data);

$links = explode("\r\n", $data);

$encrypted = '';

foreach($links as $link)
{
$encrypted .= base64_decode($link);
}

$testdata=(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $encrypted, MCRYPT_MODE_CFB, $iv2));
$test2 = str_replace("CCF: ", "", $testdata);

   $handle = fopen("zaehler.txt","w");
   fputs($handle,$test2);
   fclose($handle);
?>